/*
 * Copyright (c) 2020-2099 the original author or authors. All rights reserve.
 */
package org.tianyun.cloud.utils;

import org.apache.commons.lang3.RandomStringUtils;

import java.util.UUID;

/**
 * 随机生成工具类
 *
 * @auther ebert_chan
 */
public class RandomUtils {

    /**
     * 随机生成由字母和数字组成的字符串，长度由传入的length决定
     *
     * @param length
     * @return
     * @auther ebert_chan
     */
    public static String randomText(int length) {
        return RandomStringUtils.randomAlphanumeric(length);
    }

    /**
     * 生成UUID
     *
     * @return
     * @auther ebert_chan
     */
    public static String randomUuid() {
        return UUID.randomUUID().toString().replaceAll("-", "");
    }

}
